-
Notifications
You must be signed in to change notification settings - Fork 7.7k
doc: added documentation for input type=file #218
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need the corporate CLA signed. If you have received this in error or have any questions, please contact us at cla@fb.com. Thanks! |
Deploy preview ready! Built with commit 1ae3d1d |
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks! |
e.preventDefault(); | ||
|
||
this.setState({ | ||
file: e.target.files[0] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't think the file needs to be saved in state, unless I'm overlooking something. Probably having a ref
to the file input and use it to access the file(s) in submit handler (or wherever required) would be a better option IMHO. See if this makes sense - https://codepen.io/tsriram/pen/qVNoZL?editors=0011
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, using the file by ref is definitly a betetr solution. My bad. Will change it ASAP
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Friendly ping 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry guys, been away for a while and didn't notice the progress of the issue. Seems like @vishalvrv9 has worked on a fix of my PR based on @tsriram's suggestion. Should I go ahead and fix mine or would it better to merge his?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't reviewed his PR yet, so I don't know for sure. But since he created his when this one seemed to have been dropped, maybe we should try his?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, had some issues so I couldn't track down my PR after submitting it but the man definitly deserves some attention for his efforts ;)
Sync with reactjs.org @ b169178
Sync with reactjs.org @ a211417
Added some explaination on how to implement this form type in React as suggested in #86